package com.zcx.qshop.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2015/11/25.
 */
@HttpInlet(Conn.INLET_JSON_ORDERUPDATEADDRESS)
public class JsonOrderupdateaddressAsyGet extends QSAsyGet<JsonOrderupdateaddressAsyGet.Info> {

    public String orderid, areaid;

    public JsonOrderupdateaddressAsyGet(String orderid, String areaid, AsyCallBack<Info> asyCallBack) {

        super(asyCallBack);

        this.orderid = orderid;

        this.areaid = areaid;

    }

    @Override
    protected Info parser(JSONObject object) {

        if(object.optString("message").equals("1")){

            Info info = new Info();

            info.address = object.optString("address");

            info.name = object.optString("name");

            info.mobile = object.optString("mobile");

            return info;

        }

        return null;

    }

    public static class Info{

        public String address, name, mobile;

    }

}
